package com.wang.springbootinit.service.impl.GenChart;


import org.apache.commons.lang3.StringUtils;



public class GenChartCommonUtil {

    /**
     * 获取请求ai的消息体
     * @param goal
     * @param chartType
     * @param excelInfo
     * @return
     */
    public static String getAiHandleMessage(String goal,String chartType,String excelInfo){
        //构造用户输入
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("分析需求：").append("\n");

        // 拼接分析目标
        if (StringUtils.isNotBlank(chartType)) {
            goal += "，请使用" + chartType;
        }
        stringBuilder.append(goal).append("\n");
        stringBuilder.append("，原始数据：").append("\n");

        //压缩后的数据
        StringBuilder builder = stringBuilder.append(excelInfo).append("\n");

        return builder.toString();
    }
}
